{% extends "pc.master.default.html" %}

{%load encoding%}


{% block include %}
<link rel="stylesheet" href="/resources/css/sheet.css" type="text/css" />
	<script src="/resources/3th/jquery-jquery-ui-269fcfb/ui/jquery.ui.button.js"></script>
{% endblock %}


{% block script %}
$(document).ready(function(){
    $("#edit").click(function(){
    // {{object.house_code|add:' '|add:object.code|encode}}
				document.location.href = "/code/edit/{{object.code|encode}}";
    }).button({
        icons:{
            "primary":"ui-icon-pencil"
        }
    });


    $("#remove").button({
        icons:{
            "primary":"ui-icon-close"
        }
    });
});
{% endblock %}

{%block body %}
<div>
	<h3>Code Details</h3>
</div>

	<div>
		<fieldset>
			<legend>기본정보</legend>
			<ul class="info">
				<div class="fieldWrapper">
					<li>코드</li>
					<li>{{object.code}}</li>
				</div>
		
				<div class="fieldWrapper">
					<li>코드명</li>
					<li>{{object.description}}</li>
				</div>
				
				<div class="fieldWrapper">
					<li>사용여부</li>
					<li>{{object.used}}</li>
				</div>
				
				<div class="fieldWrapper">
					<li>설명</li>
					<li>{{object.memo}}</li>
				</div>
		
			</ul>
		</fieldset>
		<fieldset>
			<legend>관련코드정보</legend>
			<ul class="info">
				
				<li>상위코드</li>
                <li>
                    {%if object.super_code != None%}
                        <a href="/code/info/{{object.super_code.code|encode}}">
                            ({{object.super_code.code}}) {{object.super_code.description}}
                        </a>
                    {%endif%}
                </li>
				
				<li>하위코드</li>
				<li>
					{% if child_object != None%}
						<ul>
						{%for i in child_object%}
							<li>{{i}}</li>	
						{%endfor%}
						</ul>
					{%endif%}
				</li>
				
			</ul>
		</fieldset>
		
	</div>

    <div class="buttonBox">
        <button id="edit" type="button">edit</button>
        <button id="remove" type="button">remove</button>
    </div>
	
{% endblock %}
